package com.ruoyi.message.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.message.mapper.IotMessageMapper;
import com.ruoyi.message.domain.IotMessage;
import com.ruoyi.message.service.IIotMessageService;

/**
 * 消息通知Service业务层处理
 * 
 * @author wujiale
 * @date 2025-04-26
 */
@Service
public class IotMessageServiceImpl implements IIotMessageService 
{
    @Autowired
    private IotMessageMapper iotMessageMapper;
    //改状态为1
    @Override
    public int updateStatus(Long messageId) {
        return iotMessageMapper.updateStatus(messageId);
    }

    @Override
    public List<IotMessage> selectAllMessageList(IotMessage iotMessage) {
        return iotMessageMapper.selectAllMessageList(iotMessage);
    }

    /**
     * 查询消息通知
     * 
     * @param messageId 消息通知主键
     * @return 消息通知
     */
    @Override
    public IotMessage selectIotMessageByMessageId(Long messageId)
    {
        return iotMessageMapper.selectIotMessageByMessageId(messageId);
    }

    /**
     * 查询消息通知列表
     * 
     * @param iotMessage 消息通知
     * @return 消息通知
     */
    @Override
    public List<IotMessage> selectIotMessageList(IotMessage iotMessage)
    {
        return iotMessageMapper.selectIotMessageList(iotMessage);
    }

    /**
     * 新增消息通知
     * 
     * @param iotMessage 消息通知
     * @return 结果
     */
    @Override
    public int insertIotMessage(IotMessage iotMessage)
    {
        iotMessage.setCreateTime(DateUtils.getNowDate());
        return iotMessageMapper.insertIotMessage(iotMessage);
    }

    /**
     * 修改消息通知
     * 
     * @param iotMessage 消息通知
     * @return 结果
     */
    @Override
    public int updateIotMessage(IotMessage iotMessage)
    {
        iotMessage.setUpdateTime(DateUtils.getNowDate());
        return iotMessageMapper.updateIotMessage(iotMessage);
    }

    /**
     * 批量删除消息通知
     * 
     * @param messageIds 需要删除的消息通知主键
     * @return 结果
     */
    @Override
    public int deleteIotMessageByMessageIds(Long[] messageIds)
    {
        return iotMessageMapper.deleteIotMessageByMessageIds(messageIds);
    }

    /**
     * 删除消息通知信息
     * 
     * @param messageId 消息通知主键
     * @return 结果
     */
    @Override
    public int deleteIotMessageByMessageId(Long messageId)
    {
        return iotMessageMapper.deleteIotMessageByMessageId(messageId);
    }
}
